Show example
|
- Special space rows Group, Search and Toolbar
you can create also manually by Space row.
- You can do it to merge functionality of the special rows to one row or to extend their functionality.
- You can also learn here, how to define Space row cells, especially Actions and Formulas.
- In example is always the first special row and next bellow is the same row done by Space row.
- All functionality can repeated except <Toolbar> resize button functionality and TreeGrid link look.
|
Show data source
<Grid>
<Cfg id="Expert9" ResizingMain='3' GroupMain='A' ConstHeight="1" SaveAttrs="S5,List,S5a,List" />
<Cols>
<C Name="id" Type="Text"/>
<C Name="A" Type="Text"/>
<C Name="B" Type="Text"/>
<C Name="C" Type="Float"/>
<C Name="D" Type="Enum" Enum="|Zero|One|Two|Three|Four|Five|Six|Seven|Eight|Nine|Ten"/>
<C Name="E" Type="Date"/>
</Cols>
<Header
id="id"
A="Text1"
B="Text2"
C="Float"
D="Enum"
E="Date"
/>
<Body>
<B>
<I id="r01" A="James Smith" B="Paris" C="10.3" D="1" E="1/1/2000"/>
<I id="r02" A="Mark Jones" B="London" C="12" D="2" E="6/25/2007"/>
<I id="r03" A="Eric Walker" B="Berlin" C="-10.3" D="1" E="1/1/2000"/>
<I id="r04" A="James King" B="London" C="1200" D="6" E="12/31/1999"/>
<I id="r05" A="Henry Smith" B="Rome" C="0.03" D="8" E="6/24/2007"/>
<I id="r06" A="Carl Hill" B="Paris" C="12.45" D="0" E="4/8/2004"/>
<I id="r07" A="Mark Brown" B="Lisboa" C="0.345" D="10" E="10/20/2001"/>
<I id="r08" A="Joe Walker" B="Berlin" C="-12" D="3" E="10/20/2001"/>
<I id="r09" A="Eric Jones" B="Prague" C="-0.345" D="4" E="4/16/1994"/>
<I id="r10" A="James Smith" B="New York" C="4560" D="10" E="6/25/2007"/>
<I id="r11" A="Jack Reed" B="Madrid" C="1200" D="2" E="4/13/2010"/>
<I id="r12" A="Mark Brown" B="Budapest" C="10.3" D="7" E="5/6/2002"/>
<I id="r13" A="Jack Rogers" B="Moscow" C="12" D="1" E="2/18/1999"/>
<I id="r14" A="James Davis" B="Prague" C="-0.345" D="9" E="4/12/2006"/>
<I id="r15" A="Fred James" B="Moscow" C="12.46" D="9" E="3/25/2005"/>
<I id="r16" A="Billy Smith" B="Rome" C="-1200" D="2" E="1/24/2000"/>
</B>
</Body>
<Solid>
<Group
List='|None|Text2|Enum|Text->Enum|Enum->Text2'
ListCustom='Unknown'
Cols='||B|D|B,D|D,B'
Types='||0|0|0|0'
Custom='1'
/>
<I Cells='List,Custom' Space='1' NoColor='1' CanFocus='0'
ListType='Select'
ListDefaults='|None|Text2|Enum|Text->Enum|Enum->Text2'
ListAction='Grid.GroupRows(choose(null,null,["","B","D","B,D","D,B"]),choose(null,null,[null,0,0,0,0]));'
ListFormula='choose(Grid.GroupCols.join(","),["","B","D","B,D","D,B"],null,"Unknown")'
CustomType='DropCols'
CustomText='To group by drag column caption here ...'
CustomCanFocus='0'
CustomAction='Grid.GroupRows(Row[Col])'
CustomFormula='Grid.GroupCols.join(",")'
CustomRelWidth='1'
/>
<Search id="S1" Space="4" Cells="Expression" ExpressionAction="Filter"/>
<I id="S1a" Space="4" Cells="Expression"
ExpressionType="Text"
ExpressionRelWidth="1"
ExpressionAction="Grid.SearchExpression=Value;Grid.SearchRows('Filter');"
ExpressionFormula="Grid.SearchExpression"
ExpressionCanEdit='1'
Height="18"
NoColorState="1"
/>
<Search id="S2" Space="4" Cells="Expression,Filter,Select,Mark,Find,Clear,Help"/>
<I id="S2a" Space="4" Cells="Expression,Filter,Select,Mark,Find,Clear,Help"
ExpressionType="Text"
ExpressionRelWidth="1"
ExpressionAction="Grid.SearchExpression=Value;"
ExpressionFormula="Grid.SearchExpression"
ExpressionCanEdit='1'
FilterType="Button"
FilterCaption="Filter"
FilterAction="Grid.SearchRows('Filter');"
SelectType="Button"
SelectCaption="Select"
SelectAction="Grid.SearchRows('Select');"
MarkType="Button"
MarkCaption="Mark"
MarkAction="Grid.SearchRows('Mark');"
FindType="Button"
FindCaption="Find"
FindAction="Grid.SearchRows('Find');"
ClearType="Button"
ClearCaption="Clear"
ClearAction="Grid.SearchRows('Clear');"
HelpType="Button"
HelpCaption="Help"
HelpAction="Grid.SearchRows('Help');"
NoColorState="1"
/>
<Search id="S3" Space="4" Cells="Expression,Actions,Search,Clear"/>
<I id="S3a" Space="4" Cells="Expression,Actions,Search,Clear"
ExpressionType="Text"
ExpressionRelWidth="1"
ExpressionAction="Grid.SearchExpression=Value;"
ExpressionFormula="Grid.SearchExpression"
ExpressionCanEdit='1'
ActionsType="Select"
ActionsDefaults="|Filter|Select|Mark|Find"
Actions="Filter"
SearchType="Button"
SearchCaption="Search"
SearchAction="Grid.SearchRows(Actions);"
ClearType="Button"
ClearCaption="Clear"
ClearAction="Grid.SearchRows('Clear');"
NoColorState="1"
/>
<Search id="S4" Space="4" Cells="Cols,Case,Type"
ColsLabel="Columns"
ColsDefaults="|All|Text1|Text2|Text1 & Text2|Float|Enum|Date"
ColsCols="||A|B|A,B|C|D|E"
ColsToolTip="Searches only in selected columns"
CaseLabel="Case sensitive"
TypeLabel="Search in cells"
NoColor="1"
/>
<I id="S4a" Space="4" Cells="ColsLabel,Cols,CaseLabel,Case,TypeLabel,Type"
ColsLabelType="Html"
ColsLabel="Columns"
ColsLabelCanFocus="0"
ColsLabelWidth="-1"
ColsLabelNoColor="1"
ColsLabelToolTip="Searches only in selected columns"
ColsType="Select"
ColsDefaults="|All|Text1|Text2|Text1 & Text2|Float|Enum|Date"
ColsAction="Grid.SearchCols=choose(null,null,['','A','B','A,B','C','D','E']);Grid.SearchRows('Refresh');"
ColsFormula="choose(Grid.SearchCols,['','A','B','A,B','C','D','E'])"
ColsWidth="100"
ColsToolTip="Searches only in selected columns"
CaseLabelType="Html"
CaseLabel="Case sensitive"
CaseLabelCanFocus="0"
CaseLabelWidth="-1"
CaseLabelNoColor="1"
CaseType="Bool"
CaseWidth="-1"
CaseAction="Value?Grid.SearchType|=4:Grid.SearchType&=~4;Grid.SearchRows('Refresh');"
CaseFormula="Grid.SearchType&4?1:0"
CaseCanEdit="1"
TypeLabelType="Html"
TypeLabel="Search in cells"
TypeLabelToolTip="Searches only in cells, only for Mark and Find action"
TypeLabelCanFocus="0"
TypeLabelWidth="-1"
TypeLabelNoColor="1"
TypeType="Bool"
TypeWidth="-1"
TypeAction="Value?Grid.SearchType|=1:Grid.SearchType&=~1;Grid.SearchRows('Refresh');"
TypeFormula="Grid.SearchType&1"
TypeCanEdit="1"
NoColor="1"
/>
<Search id="S5" Space="4" Cells="List,Actions"
ListWidth="150"
ListDefaults="|None|This year|Last year|April|Positive float|Rome|London or Paris|James from London|Eight or less then four"
ListExpressions="@@Date>=1/1/2007 AND Date<1/1/2008@Date>=1/1/2006 AND Date<1/1/2007@(new window.Date(Date)).getMonth()==3@Float>=0@Text2 = Rome@Text2==London or Text2==Paris@Text2==London and Text1 starts James@Enum==8 || Enum<4"
ActionsAction="Refresh"
/>
<I id="S5a" Space="4" Cells="List,Actions"
ListType="Select" ListWidth="150"
ListDefaults="|None|This year|Last year|April|Positive float|Rome|London or Paris|James from London|Eight or less then four"
ListAction="Grid.SearchExpression=choose(null,null,['',
'Date>=1/1/2007 AND Date<1/1/2008',
'Date>=1/1/2006 AND Date<1/1/2007',
'(new window.Date(Date)).getMonth()==3',
'Float>=0',
'Text2 = Rome',
'Text2==London or Text2==Paris',
'Text2==London and Text1 starts James',
'Enum==8 || Enum<4'
]);Grid.SearchRows(Actions)"
ActionsType="Select"
ActionsDefaults="|Filter|Select|Mark|Find"
Actions="Filter"
NoColorState="1"
/>
<I id='Toolbar' Space='5' CanFocus='0' NoColor='1'
Cells='Reload,Print,Add,Sort,Calc,Columns,MenuCfg,Help,Link,Formula,Resize'
ReloadType='Button' ReloadIcon='1'
ReloadAction='Grid.ControlPanel.Click("Reload")'
ReloadToolTip='Reload grid, cancel changes'
PrintType='Button' PrintIcon='15'
PrintAction='Grid.ControlPanel.Click("Print")'
PrintToolTip='Print grid'
AddType='Button' AddIcon='3'
AddAction='Grid.ControlPanel.Click("Add")'
AddToolTip='Add new row or move or copy selected rows'
SortType='Button' SortFormula='Grid.Sorted'
SortIcon='6' SortIconChecked='5'
SortAction='Grid.ControlPanel.Click("Sort")'
SortToolTip='Enable sorting and re-sort rows now'
SortToolTipChecked='Disable sorting to rearange sorting faster'
CalcType='Button' CalcFormula='Grid.Calculated'
CalcIcon='8' CalcIconChecked='7'
CalcAction='Grid.ControlPanel.Click("Calc")'
CalcToolTip='Enable calculations and re-calculate grid now'
CalcToolTipChecked='Disable calculations to edit cell values faster'
ColumnsType='Button' ColumnsIcon='13'
ColumnsAction='Grid.ControlPanel.Click("Columns")'
ColumnsToolTip='Displays menu to choose visible columns'
MenuCfgType='Button' MenuCfgIcon='11'
MenuCfgAction='Grid.ControlPanel.Click("MenuCfg")'
MenuCfgToolTip='TreeGrid user settings'
HelpType='Button' HelpIcon='12'
HelpAction='Grid.ControlPanel.Click("Help")'
HelpToolTip='Show help for TreeGrid control'
LinkType='Link'
LinkRelWidth='1'
Link='|http://www.treegrid.com|EJS TreeGrid'
LinkClassOuter='none'
FormulaType='Html'
FormulaFormula='countrows()+" rows"'
FormulaWidth='-1'
FormulaClassOuter='GControlPanelFormula'
ResizeType='Button'
ResizeIcon='14'
ResizeToolTip='Out of order ...'
/>
</Solid>
<Toolbar
Formula='countrows()+" rows"'
/>
</Grid>
|